// 薪酬管理-代发工资
import serveUrl from '@/config_xc/serverAddress'; // 接口域名列表
import axios from '@/config_xc/http'; // 导入http中创建的axios实例
const electronicPayslip = {

  /**
   * @description 获取电子工资条列表
   * @param {*} data
   * @returns {Promise}
   */

  GetPaySlipList(data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/GetPaySlipList`, data);
  },

  /**
   * @description 获取工资表模板数据列表
   * @param {*} params
   * @returns {Promise}
   */
  GetPaySlipTempList(data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/GetPaySlipTempList`, data);
  },

  /**
   * @description 发放工资条
   * @param {*} data
   * @returns {Promise}
   */
  AddPayslip(data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/AddPayslip`, data);
  },

  /**
   * @description 撤销工资条
   * @param {*} params
   * @returns {Promise}
   */
  CancelIssuePayslip(params) {
    return axios.put(`${serveUrl.cs}/ElectronicPaySlip/CancelIssuePayslip`, {}, { params });
  },

  /**
   * @description 工资条发放详情列表
   * @param {*} data
   * @returns {Promise}
   */
  GetIssueDetailList(data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/GetIssueDetailList`, data);
  },

  /**
   * @description 获取发放状态
   * @returns {Promise}
   */
  GetSendStatusList() {
    return axios.get(`${serveUrl.cs}/ElectronicPaySlip/GetSendStatusList`);
  },

  /**
   * @description 获取确认状态
   * @returns {Promise}
   */
  GetConfirmStatusList() {
    return axios.get(`${serveUrl.cs}/ElectronicPaySlip/GetConfirmStatusList`);
  },

  /**
   * @description 获取查看状态
   * @returns {Promise}
   */
  GetCheckStatusList() {
    return axios.get(`${serveUrl.cs}/ElectronicPaySlip/GetCheckStatusList`);
  },

  /**
   * @description 添加工资条设置
   * @param {*} data
   * @returns
   */
  AddPayslipSetting(data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/AddPayslipSetting`, data);
  },
  // /ElectronicPaySlip/GetSettingDetail

  /**
   * @descirpion 获取工资条设置详情
   * @returns
   */
  GetSettingDetail(params) {
    return axios.get(`${serveUrl.cs}/ElectronicPaySlip/GetSettingDetail`, { params });
  },

  /**
   * @description 撤销某条发放工资条数据
   * @param {*} id 工资条id
   * @param {*} data 待撤销数据列表
   * @returns
   */
  CancelIssuePayslipData(id, data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/CancelIssuePayslipData?payslipId=${id}`, data);
  },

  /**
   * @description 获取已发放工资条用户的详情
   * @param {*} data
   * @returns
   */
  GetIssueUserDetail(data) {
    return axios.post(`${serveUrl.cs}/ElectronicPaySlip/GetIssueUserDetail`, data);
  }
};

export default electronicPayslip;
